import service from "@/utils/request.js";

export function loginApi(username, password) {
  return service({
    method: "post",
    url: "/api/login",
    data: {
      username,
      password,
    },
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    showLoading: true,
    cancelDuplicate: true, // 将cancelDuplicate设置为true以取消重复请求
  });
}

// 地图数据
export function getMapDataApi(code) {
  return service({
    url: "/api/map",
    method: "get",
    params: {
      code: code,
    },
    headers: {
      showLoading: false,
      cancelDuplicate: true, // 将cancelDuplicate设置为true以取消重复请求
    },
  });
}
